package cn;

import javax.servlet.MultipartConfigElement;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
//import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@SpringBootApplication
@ComponentScan(basePackages={"cn.*"})//指定spring要扫描的包
@ServletComponentScan
public class App{
	
	
	/*@RequestMapping("/")
	public String hello() {
		return "Hello world!";
	}*/
	
	public static void main(String[] args) {
		SpringApplication.run(App.class, args);
	}

	// 配置文件上传
	@Bean
	public MultipartConfigElement multipartConfigFactory() {
		MultipartConfigFactory configFactory = new MultipartConfigFactory();
		configFactory.setMaxFileSize("128MB");// KB MB 设置单个上传文件大小
		configFactory.setMaxRequestSize("1024MB");
		configFactory.setLocation("/");// 设置文件上传路径
		return configFactory.createMultipartConfig();
	}
}
